package com.example.blackbox.Activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.viewpager.widget.ViewPager;

import com.example.blackbox.Adapter.GuideAdapter;
import com.example.blackbox.R;

import java.util.ArrayList;

public class GuideActivity extends Activity {

    ArrayList<View> views=new ArrayList<>();
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_guide);
        ViewPager vp=(ViewPager)findViewById(R.id.guide);
        View view1= LayoutInflater.from(this).inflate(R.layout.guide1,null);
        View view2= LayoutInflater.from(this).inflate(R.layout.guide2,null);
        View view3= LayoutInflater.from(this).inflate(R.layout.guide3,null);
        views.add(view1);
        views.add(view2);
        views.add(view3);

        Button bt = (Button) view3.findViewById(R.id.guide_bt_begin);
        bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(GuideActivity.this,LoginActivity.class));
                finish();
            }
        });

        GuideAdapter myPagerAdapter=new GuideAdapter(views);
        vp.setAdapter(myPagerAdapter);
    }
}
